<template>
    <a-select :value="modelValue" :options="options" allowClear @change="handleChange" placeholder="请选择负责人" :field-names="{ label: 'username', value: 'id' }" />
</template>
<script setup lang="ts">
import { getAdminList } from '@/api/system/permission/admin'
const props = defineProps<{
    modelValue: string
}>()
const emit = defineEmits<{
    (e: 'update:modelValue', value: string): void
}>()
const options = ref([])
onMounted(async () => {
    const res = await getAdminList()
    options.value = res.lists
})
const handleChange = (value: string) => {
    emit('update:modelValue', value)
}
</script>
